/*****************************************************************************************
 * FILE NAME: drv_bkp                       COPYRIGHT (c) cos 2024
 * REVISION:  1.0.0                                     All Rights Reserved
 * DESCRIPTION:
 * =======================================================================================
 * UPDATE HISTORY:
 * REV      AUTHOR      DATE
 * v1.0.0   Tuxin       2024.10.14
 * DESCRIPTION OF CHANGE:
 ****************************************************************************************/
#ifndef __DRV_BKP_H
#define __DRV_BKP_H

//----------------------------------------------------------------------------------------
// @Project Includes
#include "typedefs.h"

//----------------------------------------------------------------------------------------
// @Global Macro Define in the module
#define  BKP_DAT1     ((uint16_t)0x0000)
#define  BKP_DAT2     ((uint16_t)0x0004)
#define  BKP_DAT3     ((uint16_t)0x0008)
#define  BKP_DAT4     ((uint16_t)0x000C)
#define  BKP_DAT5     ((uint16_t)0x0010)
#define  BKP_DAT6     ((uint16_t)0x0014)
#define  BKP_DAT7     ((uint16_t)0x0018)
#define  BKP_DAT8     ((uint16_t)0x001C)
#define  BKP_DAT9     ((uint16_t)0x0020)
#define  BKP_DAT10    ((uint16_t)0x0024)
#define  BKP_DAT11    ((uint16_t)0x0028)
#define  BKP_DAT12    ((uint16_t)0x002C)
#define  BKP_DAT13    ((uint16_t)0x0030)
#define  BKP_DAT14    ((uint16_t)0x0034)
#define  BKP_DAT15    ((uint16_t)0x0038)
#define  BKP_DAT16    ((uint16_t)0x003C)
#define  BKP_DAT17    ((uint16_t)0x0040)
#define  BKP_DAT18    ((uint16_t)0x0044)
#define  BKP_DAT19    ((uint16_t)0x0048)
#define  BKP_DAT20    ((uint16_t)0x004C)

#define  IS_BKP_DAT(DAT)                                                                                    \
             (((DAT) == BKP_DAT1)  || ((DAT) == BKP_DAT2)  || ((DAT) == BKP_DAT3)  || ((DAT) == BKP_DAT4)   \
           || ((DAT) == BKP_DAT5)  || ((DAT) == BKP_DAT6)  || ((DAT) == BKP_DAT7)  || ((DAT) == BKP_DAT8)   \
           || ((DAT) == BKP_DAT9)  || ((DAT) == BKP_DAT10) || ((DAT) == BKP_DAT11) || ((DAT) == BKP_DAT12)  \
           || ((DAT) == BKP_DAT13) || ((DAT) == BKP_DAT14) || ((DAT) == BKP_DAT15) || ((DAT) == BKP_DAT16)  \
           || ((DAT) == BKP_DAT17) || ((DAT) == BKP_DAT18) || ((DAT) == BKP_DAT19) || ((DAT) == BKP_DAT20) )

#define  BACKUP_REGISTER_SIZE        (20)

#define  USER_WRITE_BKP_DAT1_DATA    (0xA5A5)

//----------------------------------------------------------------------------------------
// @Global Type defines in the module

//----------------------------------------------------------------------------------------
// @Export global Variables declare in the module
//extern uint16_t g_u16bkpDatas[BACKUP_REGISTER_SIZE];
//extern uint32_t g_u32writeBkpDatas[BACKUP_REGISTER_SIZE];
//extern uint32_t g_u32readReadBkpDatas[BACKUP_REGISTER_SIZE];

//----------------------------------------------------------------------------------------
// @Export declaration of functions in the module
extern void drv_bkp_writeData(uint32_t BKP_DAT, uint32_t Data);
extern uint32_t drv_bkp_readData(uint32_t BKP_DAT);
extern void drv_bkp_init(void);

#endif

// =======================================================================================
// End of file.
// =======================================================================================
